package com.qf.zhijia.pojo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * cart
 * @author 
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Cart implements Serializable {
    private Integer cId;

    private Integer uId;

    private Integer pId;

    private BigDecimal cCount;

    private Integer cNum;

    private static final long serialVersionUID = 1L;

    private List<Product> product;//进行连接查询

    public BigDecimal getcCount() {
        BigDecimal sum=null;
        BigDecimal bigDecimal1 = null;
        for (Product product1 : product) {
            //进行小计的运算
            BigDecimal price = product1.getPPrice();
            BigDecimal bigDecimal = new BigDecimal(cNum);
            BigDecimal multiply= price.multiply(bigDecimal);
            bigDecimal1 = sum.subtract(multiply);
        }
        return bigDecimal1;
    }
    public void setcCount(BigDecimal cCount) {
        this.cCount = cCount;
    }


}